class Solution {
public:
    bool CheckPermutation(string s1, string s2)
    {
        int ret1 = 0, sum1 = 0;
        int ret2 = 0, sum2 = 0;

        for (auto s : s1)
        {
            ret1 ^= s;
            sum1 += s;
        }

        for (auto s : s2)
        {
            ret2 ^= s;
            sum2 += s;
        }

        return ret1 == ret2 && sum1 == sum2 ? true : false;
    }
};